package com.tm.chargecar.mapper;

import com.tm.chargecar.entity.ReDaCenterEntity;
import com.tm.chargecar.entity.RecordEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ReDaCenterMapper {

    @Select("SELECT * FROM t_dz_bs WHERE dz_bs_user=#{dzBsUser} AND dz_bs_date=#{dzBsDate} ")
    List<ReDaCenterEntity> queryReDaCenter(ReDaCenterEntity reDaCenterEntity);

    @Select("SELECT SUM(dz_bs_money) as duiZhichu, COUNT(*) as zhichuCount FROM t_dz_bs WHERE dz_bs_user=#{bsUser} AND dz_bs_date=#{duiDate} AND dz_bs_type= 1 ")
    ReDaCenterEntity queryReDaCenterSelect(RecordEntity recordEntity);
    @Select("SELECT SUM(dz_bs_money) as duiShouchu, COUNT(*) as shouruCount FROM t_dz_bs WHERE dz_bs_user=#{bsUser} AND dz_bs_date=#{duiDate} AND dz_bs_type= 0 ")
    ReDaCenterEntity queryReDaCenterSelectT(RecordEntity recordEntity);
}
